package com.huluobo.vrdemo

import android.graphics.BitmapFactory
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.google.vr.sdk.widgets.pano.VrPanoramaView

class MainActivity : AppCompatActivity() {
    private lateinit var vrPanoramaView: VrPanoramaView
    private lateinit var option: VrPanoramaView.Options
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        initVrView()
    }

    private fun initVrView() {
        vrPanoramaView = findViewById(R.id.vr_view)
        option = VrPanoramaView.Options()
        option.inputType = VrPanoramaView.Options.TYPE_MONO //设置水平轴360度旋转
        vrPanoramaView.loadImageFromBitmap(BitmapFactory.decodeResource(resources, R.drawable.bbb), option)
    }
}